import Vue from 'vue'
import Router from 'vue-router'
import Login from './views/Login.vue'
import main from './components/main'

Vue.use(Router)

export default new Router({
	mode: 'history',
	base: process.env.BASE_URL,
	routes: [{
			path: '/login',
			name: 'Login',
			component: () =>
				import( /* webpackChunkName: "login" */ './views/Login.vue'),
		},
		{
			path: '/',
			name: '_home',
			redirect: '/home',
			component: main,
			children: [{
					path: '/home',
					component: () =>
						import( /* webpackChunkName: "home" */ './views/home')
				},
				{
					path: '/appointment',
					name: 'Appointment',
					redirect: '/appointmentSee',
					component: () =>
						import ( /* webpackChunkName: "appointment" */ './views/appointment/appointment.vue'),
					children: [{
						path: '/appointmentSee',
						name: 'AppointmentSee',
						component: () =>
							import( /* webpackChunkName: "appointmentSee" */ './views/appointment/appointmentSee.vue')
					}, {
						path: '/appointmentSearch',
						name: 'AppointmentSearch',
						component: () =>
							import( /* webpackChunkName: "appointmentSearch" */ './views/appointment/appointmentSearch.vue')
					}, {
						path: '/doctorSchedule',
						name: 'DoctorSchedule',
						component: () =>
							import( /* webpackChunkName: "doctorSchedule" */ './views/appointment/doctorSchedule.vue')
					}]
				}, {
					path: "/consult",
					component: () =>
						import( /* webpackChunkName: "consult" */ './views/consult.vue')
				}, {
					path: '/setting',
					component: () =>
						import( /* webpackChunkName: "Setting" */ './views/setting.vue')

				}, {
					path: '/charge',
					component: () =>
						import( /* webpackChunkName: "charge" */ './views/charge.vue')

				}, {
					path: "/pharmacy",
					component: () =>
						import( /* webpackChunkName: "pharmacy" */ './views/pharmacy.vue')
				}, {
					path: "/implement",
					component: () =>
						import( /* webpackChunkName: "implement" */ './views/implement.vue')
				}, {
					path: "/users",
					component: () =>
						import( /* webpackChunkName: "users" */ './views/users.vue')
				}
			]
		}
	]
})
